package com.nmsl.sn.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nmsl.sn.mapper.SnFamilyMemberMapper;
import com.nmsl.sn.domain.SnFamilyMember;
import com.nmsl.sn.service.ISnFamilyMemberService;

/**
 * 家属Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-20
 */
@Service
public class SnFamilyMemberServiceImpl implements ISnFamilyMemberService 
{
    @Autowired
    private SnFamilyMemberMapper snFamilyMemberMapper;

    /**
     * 查询家属
     * 
     * @param familyMemberId 家属主键
     * @return 家属
     */
    @Override
    public SnFamilyMember selectSnFamilyMemberByFamilyMemberId(Long familyMemberId)
    {
        return snFamilyMemberMapper.selectSnFamilyMemberByFamilyMemberId(familyMemberId);
    }

    /**
     * 查询家属列表
     *
     * @param snFamilyMember 家属
     * @return 家属
     */
    @Override
    public List<SnFamilyMember> selectSnFamilyMemberList(SnFamilyMember snFamilyMember)
    {
        return snFamilyMemberMapper.selectSnFamilyMemberList(snFamilyMember);
    }

    /**
     * 新增家属
     * 
     * @param snFamilyMember 家属
     * @return 结果
     */
    @Override
    public int insertSnFamilyMember(SnFamilyMember snFamilyMember)
    {
        return snFamilyMemberMapper.insertSnFamilyMember(snFamilyMember);
    }

    /**
     * 修改家属
     * 
     * @param snFamilyMember 家属
     * @return 结果
     */
    @Override
    public int updateSnFamilyMember(SnFamilyMember snFamilyMember)
    {
        return snFamilyMemberMapper.updateSnFamilyMember(snFamilyMember);
    }

    /**
     * 批量删除家属
     * 
     * @param familyMemberIds 需要删除的家属主键
     * @return 结果
     */
    @Override
    public int deleteSnFamilyMemberByFamilyMemberIds(Long[] familyMemberIds)
    {
        return snFamilyMemberMapper.deleteSnFamilyMemberByFamilyMemberIds(familyMemberIds);
    }

    /**
     * 删除家属信息
     * 
     * @param familyMemberId 家属主键
     * @return 结果
     */
    @Override
    public int deleteSnFamilyMemberByFamilyMemberId(Long familyMemberId)
    {
        return snFamilyMemberMapper.deleteSnFamilyMemberByFamilyMemberId(familyMemberId);
    }
    /**
     * 根据患者id查找家属
     */
    @Override
    public List<SnFamilyMember> selectSnFamilyMemberByPatientId(Long patientId){
        return snFamilyMemberMapper.selectSnFamilyMemberByPatientId(patientId);
    }
}
